package com.dotflat.physicalevaluate.constant;

import lombok.Getter;
import lombok.Setter;

/**
 * *******************************
 * Created by Ron.
 * form com.tuo51
 * on 2017/8/4
 * *******************************
 */
public enum MeasureConstant {

//        String height = row.getCell(3, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue();
//        String weight = row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue();
//        String rouren = row.getCell(5, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue();
//        String xiazhi = row.getCell(6, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue();
//        String shangzhi = row.getCell(7, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue();
//        String xietiao = row.getCell(8, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue();
//        String lingmin = row.getCell(9, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue();
//        String pingheng  = row.getCell(10, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue();

    //柔韧性-坐位体前屈
    //协调性-双脚连续跳
    //上肢力量-网球掷远
    //下肢力量-立定跳远
    //灵敏性-10米折返跑
    //平衡能力-走平衡木

    HEIGHT(1, 3,"身高", null),
    WEIGHT(2,4,"体重", null),
    ROUREN(3, 5,"柔韧性", "坐位体前屈"),
    XIAZHI(4, 6,"爆发力", "立定跳远"),
    SHANGZHI(5, 7,"上肢力量", "网球掷远"),
    XIETIAO(6, 8,"协调性", "双脚连续跳"),
    LINGMIN(7, 9,"灵敏性", "10米折返跑"),
    PINGHENG(8, 10, "平衡能力", "走平衡木");

    @Getter
    @Setter
    private int staticId;

    @Getter
    @Setter
    private int minMonth = 36;

    @Getter
    @Setter
    private int maxMonth = 78;

    @Getter
    @Setter
    private int templateIndex;

    @Getter
    @Setter
    private String dimension;

    @Getter
    @Setter
    private String sport;

    @Getter
    private int historyMask;

    MeasureConstant(int staticId, int templateIndex, String dimension, String sport){
        this.staticId = staticId;
        this.templateIndex = templateIndex;
        this.dimension = dimension;
        this.sport = sport;

        this.historyMask = (1 << (staticId-1));
    }


    public static MeasureConstant getByIndex(int index){
        for (MeasureConstant v : values()) {
            if (v.getTemplateIndex() == index)
                return v;
        }
        return null;
    }

    public static MeasureConstant get(int code){
        for (MeasureConstant v : values()) {
            if (v.getStaticId() == code)
                return v;
        }
        return null;
    }
}


